package hk.m4s.lr.repair.test.ui.goods;

import android.app.FragmentManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.AdapterView;
import android.widget.TextView;

import com.alibaba.sdk.android.oss.model.PutObjectRequest;
import com.jph.takephoto.model.TImage;
import com.jph.takephoto.model.TResult;

import java.util.ArrayList;
import java.util.List;

import framework.common.Constant;
import framework.common.baseui.UeBaseActivity;
import framework.common.takephoto.CustomHelper;
import framework.common.widgets.dialogs.UeDialog;
import framework.common.zanetwork.core.UploadCallback;
import framework.common.zanetwork.core.UploadHelper;
import hk.m4s.lr.repair.test.R;
import hk.m4s.lr.repair.test.model.ImageModle;
import hk.m4s.lr.repair.test.ui.adapter.GridViewAdapter;
import hk.m4s.lr.repair.test.ui.goods.fragment.ChangeGoodsBackFragment;
import hk.m4s.lr.repair.test.ui.goods.fragment.MoneyBackFragment;
import hk.m4s.lr.repair.test.ui.goods.fragment.MoneyOrGoodsBackFragment;
import hk.m4s.lr.repair.test.utils.CustomerAlertDialog;
import hk.m4s.lr.repair.test.utils.ToastUtil;
import hk.m4s.lr.repair.test.views.InnerGridView;

/**
 * Created by qi.wang on 2017/12/4.
 * 申请售后
 */

public class ApplySaleActivity extends UeBaseActivity {

    private Context context;
    private TextView backMoneyTx;
    private TextView backMoneyGoodsTx;
    private TextView chageGoodsTx;
    MoneyBackFragment mContent=new MoneyBackFragment();
    MoneyOrGoodsBackFragment moneyOrGoodsBackFragment=new MoneyOrGoodsBackFragment();
    ChangeGoodsBackFragment changeGoodsBackFragment=new ChangeGoodsBackFragment();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        baseSetContentView(R.layout.activity_tui_shop);
        hiddenFooter();
        showGoBackBtn();
        context=this;
        backMoneyTx=(TextView)findViewById(R.id.backMoney);
        backMoneyGoodsTx=(TextView)findViewById(R.id.backMoneyGoods);
        chageGoodsTx=(TextView)findViewById(R.id.chageGoods);
        setTitleText("售后服务");
        switchContent(mContent);
    }
    public void switchContent(Fragment to) {

            FragmentTransaction transaction = ApplySaleActivity.this.getSupportFragmentManager()
                    .beginTransaction();
            transaction.replace(R.id.fl_classificationchange, to).commit();

    }
    public void onClick(View view){
         switch (view.getId()){
             case R.id.backMoney:
                 backMoneyTx.setTextColor(Color.parseColor("#ffffff"));
                 backMoneyTx.setBackgroundResource(R.drawable.btn_lowblue_backroud);
                 backMoneyGoodsTx.setTextColor(Color.parseColor("#777777"));
                 backMoneyGoodsTx.setBackgroundResource(R.drawable.btn_gray_backrouds);
                 chageGoodsTx.setTextColor(Color.parseColor("#777777"));
                 chageGoodsTx.setBackgroundResource(R.drawable.btn_gray_backrouds);
                 switchContent(mContent);
                 break;
             case R.id.backMoneyGoods:
                 backMoneyGoodsTx.setTextColor(Color.parseColor("#ffffff"));
                 backMoneyGoodsTx.setBackgroundResource(R.drawable.btn_lowblue_backroud);
                 backMoneyTx.setTextColor(Color.parseColor("#777777"));
                 backMoneyTx.setBackgroundResource(R.drawable.btn_gray_backrouds);
                 chageGoodsTx.setTextColor(Color.parseColor("#777777"));
                 chageGoodsTx.setBackgroundResource(R.drawable.btn_gray_backrouds);
                 switchContent(moneyOrGoodsBackFragment);
                 break;
             case R.id.chageGoods:
                 chageGoodsTx.setTextColor(Color.parseColor("#ffffff"));
                 chageGoodsTx.setBackgroundResource(R.drawable.btn_lowblue_backroud);
                 backMoneyGoodsTx.setTextColor(Color.parseColor("#777777"));
                 backMoneyGoodsTx.setBackgroundResource(R.drawable.btn_gray_backrouds);
                 backMoneyTx.setTextColor(Color.parseColor("#777777"));
                 backMoneyTx.setBackgroundResource(R.drawable.btn_gray_backrouds);
                 switchContent(changeGoodsBackFragment);
                 break;
         }
    }

}
